﻿using CIS.Common.Dtos.ReportDtos;
using CIS.Events.Contracts.Equipments;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CIS.Server.EQLinker.Equipment
{
    public class EquipmentReportHandler : 
        IRequestHandler<UnitStatusChangeReportDto>,
        IRequestHandler<PortStatusChangeReportDto>
    {
        public async Task Handle(UnitStatusChangeReportDto request, CancellationToken cancellationToken)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff")}Received {request.SourceId} {request.EventName}");
        }

        public async Task Handle(PortStatusChangeReportDto request, CancellationToken cancellationToken)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff")}  Received {request.SourceId} {request.EventName}");
        }
    }
}
